﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace AcademiaInteligenteWeb
{
    public partial class MainPlanoExercicio : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            AtualizarGrid();
        }
        protected void lnkExcluir_Click(object sender, EventArgs e)
        {
            new WsAcademiaInteligente.WsAcademiaInteligenteSoapClient().ExcluirPlanoExercicioPorID(Convert.ToInt32(hfCurrentItem.Value));
            AtualizarGrid();
        }

        public void AtualizarGrid()
        {
            grdPlanoExercicio.DataSource = new WsAcademiaInteligente.WsAcademiaInteligenteSoapClient().SelecionarPlanoExercicioPorAcademiaCliente(Convert.ToInt32(Session[Util.SESSION_ACADEMIA_ID]), Convert.ToInt32(Request["id_cliente"]));
            grdPlanoExercicio.DataBind();
        }
        protected void lnkAlterar_Click(object sender, EventArgs e)
        {
            Response.Redirect("NewPlanoExercicio.aspx?id=" + hfCurrentItem.Value + "&id_cliente=" + Convert.ToInt32(Request["id_cliente"]) + "&id_academia=" + Convert.ToInt32(Session[Util.SESSION_ACADEMIA_ID]));
        }
    }
}